<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pango Interaction: GDK 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK 3 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk3-Threads.html" title="Threads">
<link rel="next" href="gdk3-Cairo-Interaction.html" title="Cairo Interaction">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gdk3-Pango-Interaction.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gdk3-Threads.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdk3-Cairo-Interaction.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk3-Pango-Interaction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk3-Pango-Interaction.top_of_page"></a>Pango Interaction</span></h2>
<p>Pango Interaction — Using Pango in GDK</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk3-Pango-Interaction.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/cairo/cairo-Regions.html#cairo-region-t"><span class="returnvalue">cairo_region_t</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Pango-Interaction.html#gdk-pango-layout-get-clip-region" title="gdk_pango_layout_get_clip_region ()">gdk_pango_layout_get_clip_region</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/cairo/cairo-Regions.html#cairo-region-t"><span class="returnvalue">cairo_region_t</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Pango-Interaction.html#gdk-pango-layout-line-get-clip-region" title="gdk_pango_layout_line_get_clip_region ()">gdk_pango_layout_line_get_clip_region</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">PangoContext</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Pango-Interaction.html#gdk-pango-context-get" title="gdk_pango_context_get ()">gdk_pango_context_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">PangoContext</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Pango-Interaction.html#gdk-pango-context-get-for-screen" title="gdk_pango_context_get_for_screen ()">gdk_pango_context_get_for_screen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">PangoContext</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Pango-Interaction.html#gdk-pango-context-get-for-display" title="gdk_pango_context_get_for_display ()">gdk_pango_context_get_for_display</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk3-Pango-Interaction.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk/gdk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gdk3-Pango-Interaction.description"></a><h2>Description</h2>
<p>Pango is the text layout system used by GDK and GTK+. The functions
and types in this section are used to obtain clip regions for
<span class="type">PangoLayouts</span>, and to get <span class="type">PangoContexts</span> that can be used with
GDK.</p>
<p>Creating a <span class="type">PangoLayout</span> object is the first step in rendering text,
and requires getting a handle to a <span class="type">PangoContext</span>. For GTK+ programs,
you’ll usually want to use <code class="function">gtk_widget_get_pango_context()</code>, or
<code class="function">gtk_widget_create_pango_layout()</code>, rather than using the lowlevel
<a class="link" href="gdk3-Pango-Interaction.html#gdk-pango-context-get-for-screen" title="gdk_pango_context_get_for_screen ()"><code class="function">gdk_pango_context_get_for_screen()</code></a>. Once you have a <span class="type">PangoLayout</span>, you
can set the text and attributes of it with Pango functions like
<code class="function">pango_layout_set_text()</code> and get its size with <code class="function">pango_layout_get_size()</code>.
(Note that Pango uses a fixed point system internally, so converting
between Pango units and pixels using PANGO_SCALE
or the <code class="function">PANGO_PIXELS()</code> macro.)</p>
<p>Rendering a Pango layout is done most simply with <code class="function">pango_cairo_show_layout()</code>;
you can also draw pieces of the layout with <code class="function">pango_cairo_show_layout_line()</code>.</p>
<div class="refsect3">
<a name="rotated-example"></a><h4>Draw transformed text with Pango and cairo</h4>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="cp">#define RADIUS 100</span>
<span class="cp">#define N_WORDS 10</span>
<span class="cp">#define FONT &quot;Sans Bold 18&quot;</span>

<span class="n">PangoContext</span> <span class="o">*</span><span class="n">context</span><span class="p">;</span>
<span class="n">PangoLayout</span> <span class="o">*</span><span class="n">layout</span><span class="p">;</span>
<span class="n">PangoFontDescription</span> <span class="o">*</span><span class="n">desc</span><span class="p">;</span>

<span class="kt">double</span> <span class="n">radius</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">i</span><span class="p">;</span>

<span class="c1">// Set up a transformation matrix so that the user space coordinates for</span>
<span class="c1">// where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]</span>
<span class="c1">// We first center, then change the scale</span>

<span class="n">width</span> <span class="o">=</span> <span class="n">gdk_window_get_width</span> <span class="p">(</span><span class="n">window</span><span class="p">);</span>
<span class="n">height</span> <span class="o">=</span> <span class="n">gdk_window_get_height</span> <span class="p">(</span><span class="n">window</span><span class="p">);</span>
<span class="n">radius</span> <span class="o">=</span> <span class="n">MIN</span> <span class="p">(</span><span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">)</span> <span class="o">/</span> <span class="mf">2.</span><span class="p">;</span>

<span class="n">cairo_translate</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span>
                 <span class="n">radius</span> <span class="o">+</span> <span class="p">(</span><span class="n">width</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">radius</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">,</span>
                 <span class="n">radius</span> <span class="o">+</span> <span class="p">(</span><span class="n">height</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">radius</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">);</span>
                 <span class="n">cairo_scale</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">radius</span> <span class="o">/</span> <span class="n">RADIUS</span><span class="p">,</span> <span class="n">radius</span> <span class="o">/</span> <span class="n">RADIUS</span><span class="p">);</span>

<span class="c1">// Create a PangoLayout, set the font and text</span>
<span class="n">context</span> <span class="o">=</span> <span class="n">gdk_pango_context_get_for_screen</span> <span class="p">(</span><span class="n">screen</span><span class="p">);</span>
<span class="n">layout</span> <span class="o">=</span> <span class="n">pango_layout_new</span> <span class="p">(</span><span class="n">context</span><span class="p">);</span>
<span class="n">pango_layout_set_text</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="s">&quot;Text&quot;</span><span class="p">,</span> <span class="mi">-1</span><span class="p">);</span>
<span class="n">desc</span> <span class="o">=</span> <span class="n">pango_font_description_from_string</span> <span class="p">(</span><span class="n">FONT</span><span class="p">);</span>
<span class="n">pango_layout_set_font_description</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="n">desc</span><span class="p">);</span>
<span class="n">pango_font_description_free</span> <span class="p">(</span><span class="n">desc</span><span class="p">);</span>

<span class="c1">// Draw the layout N_WORDS times in a circle</span>
<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">N_WORDS</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
  <span class="p">{</span>
    <span class="kt">double</span> <span class="n">red</span><span class="p">,</span> <span class="n">green</span><span class="p">,</span> <span class="n">blue</span><span class="p">;</span>
    <span class="kt">double</span> <span class="n">angle</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">G_PI</span> <span class="o">*</span> <span class="n">i</span> <span class="o">/</span> <span class="n">n_words</span><span class="p">;</span>

    <span class="n">cairo_save</span> <span class="p">(</span><span class="n">cr</span><span class="p">);</span>

    <span class="c1">// Gradient from red at angle == 60 to blue at angle == 300</span>
    <span class="n">red</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">cos</span> <span class="p">(</span><span class="n">angle</span> <span class="o">-</span> <span class="mi">60</span><span class="p">))</span> <span class="o">/</span> <span class="mi">2</span><span class="p">;</span>
    <span class="n">green</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
    <span class="n">blue</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">-</span> <span class="n">red</span><span class="p">;</span>

    <span class="n">cairo_set_source_rgb</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">red</span><span class="p">,</span> <span class="n">green</span><span class="p">,</span> <span class="n">blue</span><span class="p">);</span>
    <span class="n">cairo_rotate</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">angle</span><span class="p">);</span>

    <span class="c1">// Inform Pango to re-layout the text with the new transformation matrix</span>
    <span class="n">pango_cairo_update_layout</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">layout</span><span class="p">);</span>

    <span class="n">pango_layout_get_size</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">width</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">height</span><span class="p">);</span>

    <span class="n">cairo_move_to</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="o">-</span> <span class="n">width</span> <span class="o">/</span> <span class="mi">2</span> <span class="o">/</span> <span class="n">PANGO_SCALE</span><span class="p">,</span> <span class="o">-</span> <span class="n">DEFAULT_TEXT_RADIUS</span><span class="p">);</span>
    <span class="n">pango_cairo_show_layout</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">layout</span><span class="p">);</span>

    <span class="n">cairo_restore</span> <span class="p">(</span><span class="n">cr</span><span class="p">);</span>
  <span class="p">}</span>

<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">layout</span><span class="p">);</span>
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">context</span><span class="p">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
</div>
<div class="refsect3">
<a name="id-1.2.27.5.6"></a><h4>Output of the <a class="link" href="gdk3-Pango-Interaction.html#rotated-example" title="Draw transformed text with Pango and cairo">example</a> above.</h4>
<p><span class="inlinemediaobject"><img src="rotated-text.png"></span></p>
</div>
</div>
<div class="refsect1">
<a name="gdk3-Pango-Interaction.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-pango-layout-get-clip-region"></a><h3>gdk_pango_layout_get_clip_region ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/cairo/cairo-Regions.html#cairo-region-t"><span class="returnvalue">cairo_region_t</span></a> *
gdk_pango_layout_get_clip_region (<em class="parameter"><code><span class="type">PangoLayout</span> *layout</code></em>,
                                  <em class="parameter"><code><span class="type">gint</span> x_origin</code></em>,
                                  <em class="parameter"><code><span class="type">gint</span> y_origin</code></em>,
                                  <em class="parameter"><code>const <span class="type">gint</span> *index_ranges</code></em>,
                                  <em class="parameter"><code><span class="type">gint</span> n_ranges</code></em>);</pre>
<p>Obtains a clip region which contains the areas where the given ranges
of text would be drawn. <em class="parameter"><code>x_origin</code></em>
 and <em class="parameter"><code>y_origin</code></em>
 are the top left point
to center the layout. <em class="parameter"><code>index_ranges</code></em>
 should contain
ranges of bytes in the layout’s text.</p>
<p>Note that the regions returned correspond to logical extents of the text
ranges, not ink extents. So the drawn layout may in fact touch areas out of
the clip region.  The clip region is mainly useful for highlightling parts
of text, such as when text is selected.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gdk-pango-layout-get-clip-region.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>layout</p></td>
<td class="parameter_description"><p>a <span class="type">PangoLayout</span> </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_origin</p></td>
<td class="parameter_description"><p>X pixel where you intend to draw the layout with this clip</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_origin</p></td>
<td class="parameter_description"><p>Y pixel where you intend to draw the layout with this clip</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>index_ranges</p></td>
<td class="parameter_description"><p>array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n_ranges</p></td>
<td class="parameter_description"><p>number of ranges in <em class="parameter"><code>index_ranges</code></em>
, i.e. half the size of <em class="parameter"><code>index_ranges</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pango-layout-get-clip-region.returns"></a><h4>Returns</h4>
<p> a clip region containing the given ranges</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pango-layout-line-get-clip-region"></a><h3>gdk_pango_layout_line_get_clip_region ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/cairo/cairo-Regions.html#cairo-region-t"><span class="returnvalue">cairo_region_t</span></a> *
gdk_pango_layout_line_get_clip_region (<em class="parameter"><code><span class="type">PangoLayoutLine</span> *line</code></em>,
                                       <em class="parameter"><code><span class="type">gint</span> x_origin</code></em>,
                                       <em class="parameter"><code><span class="type">gint</span> y_origin</code></em>,
                                       <em class="parameter"><code>const <span class="type">gint</span> *index_ranges</code></em>,
                                       <em class="parameter"><code><span class="type">gint</span> n_ranges</code></em>);</pre>
<p>Obtains a clip region which contains the areas where the given
ranges of text would be drawn. <em class="parameter"><code>x_origin</code></em>
 and <em class="parameter"><code>y_origin</code></em>
 are the top left
position of the layout. <em class="parameter"><code>index_ranges</code></em>

should contain ranges of bytes in the layout’s text. The clip
region will include space to the left or right of the line (to the
layout bounding box) if you have indexes above or below the indexes
contained inside the line. This is to draw the selection all the way
to the side of the layout. However, the clip region is in line coordinates,
not layout coordinates.</p>
<p>Note that the regions returned correspond to logical extents of the text
ranges, not ink extents. So the drawn line may in fact touch areas out of
the clip region.  The clip region is mainly useful for highlightling parts
of text, such as when text is selected.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gdk-pango-layout-line-get-clip-region.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>line</p></td>
<td class="parameter_description"><p>a <span class="type">PangoLayoutLine</span> </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_origin</p></td>
<td class="parameter_description"><p>X pixel where you intend to draw the layout line with this clip</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_origin</p></td>
<td class="parameter_description"><p>baseline pixel where you intend to draw the layout line with this clip</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>index_ranges</p></td>
<td class="parameter_description"><p>array of byte indexes into the layout,
where even members of array are start indexes and odd elements
are end indexes. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_ranges</p></td>
<td class="parameter_description"><p>number of ranges in <em class="parameter"><code>index_ranges</code></em>
, i.e. half the size of <em class="parameter"><code>index_ranges</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pango-layout-line-get-clip-region.returns"></a><h4>Returns</h4>
<p> a clip region containing the given ranges</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pango-context-get"></a><h3>gdk_pango_context_get ()</h3>
<pre class="programlisting"><span class="returnvalue">PangoContext</span> *
gdk_pango_context_get (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a <span class="type">PangoContext</span> for the default GDK screen.</p>
<p>The context must be freed when you’re finished with it.</p>
<p>When using GTK+, normally you should use <code class="function">gtk_widget_get_pango_context()</code>
instead of this function, to get the appropriate context for
the widget you intend to render text onto.</p>
<p>The newly created context will have the default font options (see
<a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a>) for the default screen; if these options
change it will not be updated. Using <code class="function">gtk_widget_get_pango_context()</code>
is more convenient if you want to keep a context around and track
changes to the screen’s font rendering settings.</p>
<div class="refsect3">
<a name="gdk-pango-context-get.returns"></a><h4>Returns</h4>
<p>a new <span class="type">PangoContext</span> for the default display. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pango-context-get-for-screen"></a><h3>gdk_pango_context_get_for_screen ()</h3>
<pre class="programlisting"><span class="returnvalue">PangoContext</span> *
gdk_pango_context_get_for_screen (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
<p>Creates a <span class="type">PangoContext</span> for <em class="parameter"><code>screen</code></em>
.</p>
<p>The context must be freed when you’re finished with it.</p>
<p>When using GTK+, normally you should use <code class="function">gtk_widget_get_pango_context()</code>
instead of this function, to get the appropriate context for
the widget you intend to render text onto.</p>
<p>The newly created context will have the default font options
(see <a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a>) for the screen; if these options
change it will not be updated. Using <code class="function">gtk_widget_get_pango_context()</code>
is more convenient if you want to keep a context around and track
changes to the screen’s font rendering settings.</p>
<div class="refsect3">
<a name="gdk-pango-context-get-for-screen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>screen</p></td>
<td class="parameter_description"><p>the <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> for which the context is to be created.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pango-context-get-for-screen.returns"></a><h4>Returns</h4>
<p>a new <span class="type">PangoContext</span> for <em class="parameter"><code>screen</code></em>
. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pango-context-get-for-display"></a><h3>gdk_pango_context_get_for_display ()</h3>
<pre class="programlisting"><span class="returnvalue">PangoContext</span> *
gdk_pango_context_get_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>);</pre>
<p>Creates a <span class="type">PangoContext</span> for <em class="parameter"><code>display</code></em>
.</p>
<p>The context must be freed when you’re finished with it.</p>
<p>When using GTK+, normally you should use <code class="function">gtk_widget_get_pango_context()</code>
instead of this function, to get the appropriate context for
the widget you intend to render text onto.</p>
<p>The newly created context will have the default font options
(see <a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a>) for the display; if these options
change it will not be updated. Using <code class="function">gtk_widget_get_pango_context()</code>
is more convenient if you want to keep a context around and track
changes to the font rendering settings.</p>
<div class="refsect3">
<a name="gdk-pango-context-get-for-display.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>display</p></td>
<td class="parameter_description"><p>the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> for which the context is to be created</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pango-context-get-for-display.returns"></a><h4>Returns</h4>
<p>a new <span class="type">PangoContext</span> for <em class="parameter"><code>display</code></em>
. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>